﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using eStock.hControl;
using HCommon;
namespace eStock
{
    public partial class frmStockReport : hForm
    {
        public frmStockReport()
        {
            InitializeComponent();
            //this.QueryButton = btnFind;
        }

        private void btnFind_Click(object sender, EventArgs e)
        {
            LoadGrid();
        }

        private void LoadGrid()
        {
            try
            {
                if (datFromDate.Value.ToString().Trim().Length == 0)
                {
                    Dialog.ShowMess(Dialog.mType.warn, "Vui lòng nhập Ngày tra cứu");
                    return;
                }
                DataTable dt = new DataTable();
                dt = Dao.Get_Table("Exec spStockReport '" + datFromDate.Value.ToString("yyyyMMdd") + "'");
                grdReport.DataSource = dt;
            }
            catch (Exception ex)
            {
                Common.GhiLog("LoadGrid", ex);
                Dialog.ShowMess(Dialog.mType.err, ex.Message);
            }
        }

        private void frmStockReport_Load(object sender, EventArgs e)
        {
            LoadGrid();
        }

        private void hButton1_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Test");
        }

        

    }
}
